<template>
  <DataList
  :excelHeader="excelHeader"
  skipExcelNumber="2"
  :cate="cate" 
  :cols="cols"
  :name="name"
  />
</template>
<script>
import DataList from "@/components/DataList";
import { getUser } from "@/utils/auth";
import linq from "linq"
import { addBcsm, deleteBcsm, updateBcsm, getBcsm, BulkAddBcsm } from "@/api/平台未尽事宜有关说明.js";
export default {
  components: {
    DataList
  },
  data() {
    return {
      cate: "A12补充说明",
      name: '12.1 平台未尽事宜说明',
       excelHeader:{B3:"有关说明"},
      cols: [
        { label: "有关说明", prop: "BCSM" },
      ]
    };
  },
  methods: {
    onadd(model) {
      //
      var temp = JSON.parse(JSON.stringify(model))
      return new Promise(async (resolve,reject)=>{
           
      
          console.log(JSON.stringify(temp));
          var model = await addBcsm(temp);
          resolve(model);
      })
      
    },
    onupdate(model) {
      //
      var temp = JSON.parse(JSON.stringify(model))
      return new Promise(async (resolve,reject)=>{
           
          console.log(JSON.stringify(temp));
          var model = await updateBcsm(temp);
          resolve(model);
      })
      //
    },
    ondelete(model) {
       var temp = JSON.parse(JSON.stringify(model))
      return new Promise(async (resolve,reject)=>{
        
         await deleteBcsm(temp);
          resolve();
      })
    },
    async fetchData() {
      var user = getUser();
      var datas = await getBcsm(user.XXID,user.CJPC);
      return datas;
    },
    async  bulkAdd(array){
       await  BulkAddBcsm({Bcsm:array});
    }
  },
};
</script>
<style>
</style>